load(
    "//tools:defaults.bzl",
    "markdown_to_html",
    "ng_project",
    "ng_web_test_suite",
)

package(default_visibility = ["//visibility:public"])

ng_project(
    name = "tree",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    deps = [
        "//:node_modules/@angular/core",
        "//:node_modules/rxjs",
        "//src:dev_mode_types",
        "//src/cdk/a11y",
        "//src/cdk/bidi",
        "//src/cdk/coercion/private",
        "//src/cdk/collections",
        "//src/cdk/keycodes",
    ],
)

ng_project(
    name = "unit_test_sources",
    testonly = True,
    srcs = glob(
        ["**/*.spec.ts"],
        exclude = ["**/*.e2e.spec.ts"],
    ),
    deps = [
        ":tree",
        "//:node_modules/@angular/common",
        "//:node_modules/@angular/core",
        "//:node_modules/rxjs",
        "//src/cdk/a11y",
        "//src/cdk/bidi",
        "//src/cdk/collections",
        "//src/cdk/keycodes",
        "//src/cdk/testing/private",
        "//src/cdk/testing/testbed",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [":unit_test_sources"],
)

markdown_to_html(
    name = "overview",
    srcs = [":tree.md"],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)
